#ifndef _PARAMETERS_HPP
#define _PARAMETERS_HPP 1

#include <string>
#include <stdint.h>

namespace BFT
{
	class Parameters
	{
		public:
		
		static uint32_t maxRequestSize; //really needed?
		static int toleratedOrderCrashes;
    		static int toleratedOrderLiars;
    		static int toleratedExecutionCrashes;
    		static int toleratedExecutionLiars;
    		static int toleratedFilterCrashes;
 		static int toleratedFilterLiars;
		static int numberOfClients;

		static bool filtered;
		static bool debug;
		static bool insecure;

		static std::string provider;
		//static String provider="SunJCE";
		//static String provider="";
		
		static int getExecutionCount();
		static int getExecutionLiars();
		static int getExecutionCrashes();
		static int getOrderCrashes();
		static int getOrderLiars();
		static int getOrderCount();
		static int getNumberOfClients();
		static int getFilterLiars();
		static int getFilterCrashes();
		static int getFilterCount();
		static int smallExecutionQuorumSize();
		static int largeExecutionQuorumSize();
		static int smallOrderQuorumSize();
		static int largeOrderQuorumSize();
		static int fastOrderQuorumSize();
		static int smallFilterQuorumSize();
		static int mediumFilterQuorumSize();
		static int largeFilterQuorumSize();
		static bool checkId(std::string role, int id);
	};


inline int Parameters::getExecutionCount(){ return toleratedExecutionCrashes + toleratedExecutionLiars + 1; }
inline int Parameters::getExecutionLiars(){ return toleratedExecutionLiars;}
inline int Parameters::getExecutionCrashes(){ return toleratedExecutionCrashes;}
inline int Parameters::getOrderCrashes(){ return toleratedOrderCrashes;}
inline int Parameters::getOrderLiars(){ return toleratedOrderLiars;}
inline int Parameters::getOrderCount(){ return 2 * toleratedOrderCrashes + toleratedOrderLiars + 1;}
inline int Parameters::getNumberOfClients(){ return numberOfClients;}
inline int Parameters::getFilterLiars(){return toleratedFilterLiars;}
inline int Parameters::getFilterCrashes(){return toleratedFilterCrashes;}
  inline int Parameters::getFilterCount(){return 0;}
  inline int Parameters::smallFilterQuorumSize() {return 0;}
  inline int Parameters::mediumFilterQuorumSize() {return 0;}
  inline int Parameters::largeFilterQuorumSize() {return 0;}
 inline int Parameters::smallExecutionQuorumSize() {return 0;}
 inline int Parameters::largeExecutionQuorumSize() {return 0;}
 inline int Parameters::smallOrderQuorumSize() {return (getOrderCount() - getOrderCrashes())/2+1;}
 inline int Parameters::largeOrderQuorumSize() {return getOrderCount() - getOrderCrashes();}
 inline int Parameters::fastOrderQuorumSize() {return getOrderCount();}
//inline void Parameters::dbprint(char*) {if(debug) fprintf(stderr,"%s",char*);}

} //namespace BFT


#endif
